Optimal. Leaf size=147 \[ -\frac {(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac {\sqrt {b} (3 a-4 b) \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^3 f \sqrt {a-b}}-\frac {b \sec (e+f x)}{a^2 f \left (a+b \sec ^2(e+f x)-b\right )}-\frac {\cot (e+f x) \csc (e+f x)}{2 a f \left (a+b \sec ^2(e+f x)-b\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3664, 471, 527, 522, 207, 205} \[ -\frac {b \sec (e+f x)}{a^2 f \left (a+b \sec ^2(e+f x)-b\right )}-\frac {(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac {\sqrt {b} (3 a-4 b) \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^3 f \sqrt {a-b}}-\frac {\cot (e+f x) \csc (e+f x)}{2 a f \left (a+b \sec ^2(e+f x)-b\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 207
Rule 471
Rule 522
Rule 527
Rule 3664
Rubi steps
\begin {align*} \int \frac {\csc ^3(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2}{\left (-1+x^2\right )^2 \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}+\frac {\operatorname {Subst}\left (\int \frac {a-b-3 b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )^2} \, dx,x,\sec (e+f x)\right )}{2 a f}\\ &=-\frac {\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac {b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}+\frac {\operatorname {Subst}\left (\int \frac {2 (a-2 b) (a-b)-4 (a-b) b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{4 a^2 (a-b) f}\\ &=-\frac {\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac {b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}+\frac {(a-4 b) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 a^3 f}-\frac {((3 a-4 b) b) \operatorname {Subst}\left (\int \frac {1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{2 a^3 f}\\ &=-\frac {(3 a-4 b) \sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{2 a^3 \sqrt {a-b} f}-\frac {(a-4 b) \tanh ^{-1}(\cos (e+f x))}{2 a^3 f}-\frac {\cot (e+f x) \csc (e+f x)}{2 a f \left (a-b+b \sec ^2(e+f x)\right )}-\frac {b \sec (e+f x)}{a^2 f \left (a-b+b \sec ^2(e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.31, size = 325, normalized size = 2.21 \[ \frac {(a-4 b) \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 a^3 f}+\frac {(4 b-a) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 a^3 f}-\frac {\sqrt {b} (3 a-4 b) \sqrt {a-b} \tan ^{-1}\left (\frac {\sec \left (\frac {1}{2} (e+f x)\right ) \left (\sqrt {a-b} \cos \left (\frac {1}{2} (e+f x)\right )-\sqrt {a} \sin \left (\frac {1}{2} (e+f x)\right )\right )}{\sqrt {b}}\right )}{2 a^3 f (b-a)}-\frac {\sqrt {b} (3 a-4 b) \sqrt {a-b} \tan ^{-1}\left (\frac {\sec \left (\frac {1}{2} (e+f x)\right ) \left (\sqrt {a-b} \cos \left (\frac {1}{2} (e+f x)\right )+\sqrt {a} \sin \left (\frac {1}{2} (e+f x)\right )\right )}{\sqrt {b}}\right )}{2 a^3 f (b-a)}-\frac {b \cos (e+f x)}{a^2 f (a \cos (2 (e+f x))+a-b \cos (2 (e+f x))+b)}-\frac {\csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 a^2 f}+\frac {\sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 a^2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.56, size = 672, normalized size = 4.57 \[ \left [\frac {2 \, {\left (a^{2} - 2 \, a b\right )} \cos \left (f x + e\right )^{3} + 4 \, a b \cos \left (f x + e\right ) - {\left ({\left (3 \, a^{2} - 7 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - {\left (3 \, a^{2} - 10 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 3 \, a b + 4 \, b^{2}\right )} \sqrt {-\frac {b}{a - b}} \log \left (-\frac {{\left (a - b\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (a - b\right )} \sqrt {-\frac {b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) - {\left ({\left (a^{2} - 5 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - {\left (a^{2} - 6 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - a b + 4 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{2} - 5 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - {\left (a^{2} - 6 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - a b + 4 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{4} - a^{3} b\right )} f \cos \left (f x + e\right )^{4} - a^{3} b f - {\left (a^{4} - 2 \, a^{3} b\right )} f \cos \left (f x + e\right )^{2}\right )}}, \frac {2 \, {\left (a^{2} - 2 \, a b\right )} \cos \left (f x + e\right )^{3} + 4 \, a b \cos \left (f x + e\right ) - 2 \, {\left ({\left (3 \, a^{2} - 7 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - {\left (3 \, a^{2} - 10 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 3 \, a b + 4 \, b^{2}\right )} \sqrt {\frac {b}{a - b}} \arctan \left (-\frac {{\left (a - b\right )} \sqrt {\frac {b}{a - b}} \cos \left (f x + e\right )}{b}\right ) - {\left ({\left (a^{2} - 5 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - {\left (a^{2} - 6 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - a b + 4 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{2} - 5 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - {\left (a^{2} - 6 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - a b + 4 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{4} - a^{3} b\right )} f \cos \left (f x + e\right )^{4} - a^{3} b f - {\left (a^{4} - 2 \, a^{3} b\right )} f \cos \left (f x + e\right )^{2}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.65, size = 229, normalized size = 1.56 \[ -\frac {b \cos \left (f x +e \right )}{2 f \,a^{2} \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}+\frac {3 b \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {\left (a -b \right ) b}}\right )}{2 f \,a^{2} \sqrt {\left (a -b \right ) b}}-\frac {2 b^{2} \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {\left (a -b \right ) b}}\right )}{f \,a^{3} \sqrt {\left (a -b \right ) b}}+\frac {1}{4 f \,a^{2} \left (-1+\cos \left (f x +e \right )\right )}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {\ln \left (-1+\cos \left (f x +e \right )\right ) b}{f \,a^{3}}+\frac {1}{4 f \,a^{2} \left (1+\cos \left (f x +e \right )\right )}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{4 f \,a^{2}}+\frac {\ln \left (1+\cos \left (f x +e \right )\right ) b}{f \,a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.37, size = 917, normalized size = 6.24 \[ \frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,a^2\,f}-\frac {\frac {a}{2}-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (a-6\,b\right )+\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (a^2-8\,a\,b+16\,b^2\right )}{2\,a}}{f\,\left (4\,a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+4\,a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (16\,a^2\,b-8\,a^3\right )\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (a-4\,b\right )}{2\,a^3\,f}+\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {2\,a^2\,\left (\frac {\sqrt {b}\,\left (3\,a-4\,b\right )\,\left (12\,a^6\,b-106\,a^5\,b^2+240\,a^4\,b^3-160\,a^3\,b^4\right )}{2\,a^9\,\sqrt {a-b}}+\frac {b^{3/2}\,{\left (3\,a-4\,b\right )}^3\,\left (8\,a^{11}-32\,a^{10}\,b+32\,a^9\,b^2\right )}{32\,a^{15}\,{\left (a-b\right )}^{3/2}}\right )\,\left (a-b\right )\,\left (15\,a^4-182\,a^3\,b+648\,a^2\,b^2-864\,a\,b^3+384\,b^4\right )}{\left (9\,a^2\,b-24\,a\,b^2+16\,b^3\right )\,\left (4\,a^3-27\,a^2\,b+72\,a\,b^2-48\,b^3\right )}-\frac {4\,a^7\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,{\left (a-b\right )}^{3/2}\,\left (\frac {\left (\frac {4\,\left (9\,a^2\,b^2-24\,a\,b^3+16\,b^4\right )}{a^5}-\frac {b\,{\left (3\,a-4\,b\right )}^2\,\left (2\,a^8-46\,a^7\,b+344\,a^6\,b^2-672\,a^5\,b^3+384\,a^4\,b^4\right )}{4\,a^{11}\,\left (a-b\right )}\right )\,\left (a^4-31\,a^3\,b+180\,a^2\,b^2-336\,a\,b^3+192\,b^4\right )}{\sqrt {b}\,\left (b\,\left (27\,a^7+b\,\left (48\,a^5\,b-72\,a^6\right )\right )-4\,a^8\right )}+\frac {\left (\frac {\sqrt {b}\,\left (3\,a-4\,b\right )\,\left (9\,a^5\,b-78\,a^4\,b^2+268\,a^3\,b^3-384\,a^2\,b^4+192\,a\,b^5\right )}{a^8\,\sqrt {a-b}}-\frac {b^{3/2}\,{\left (3\,a-4\,b\right )}^3\,\left (-4\,a^{10}+104\,a^9\,b-288\,a^8\,b^2+192\,a^7\,b^3\right )}{16\,a^{14}\,{\left (a-b\right )}^{3/2}}\right )\,\left (15\,a^4-182\,a^3\,b+648\,a^2\,b^2-864\,a\,b^3+384\,b^4\right )}{2\,a^5\,\sqrt {a-b}\,\left (4\,a^3-27\,a^2\,b+72\,a\,b^2-48\,b^3\right )}\right )}{9\,a^2\,b-24\,a\,b^2+16\,b^3}+\frac {4\,a^7\,{\left (a-b\right )}^{3/2}\,\left (\frac {2\,\left (9\,a^3\,b^2-60\,a^2\,b^3+112\,a\,b^4-64\,b^5\right )}{a^6}+\frac {b\,{\left (3\,a-4\,b\right )}^2\,\left (-4\,a^9+56\,a^8\,b-160\,a^7\,b^2+128\,a^6\,b^3\right )}{8\,a^{12}\,\left (a-b\right )}\right )\,\left (a^4-31\,a^3\,b+180\,a^2\,b^2-336\,a\,b^3+192\,b^4\right )}{\sqrt {b}\,\left (b\,\left (27\,a^7+b\,\left (48\,a^5\,b-72\,a^6\right )\right )-4\,a^8\right )\,\left (9\,a^2\,b-24\,a\,b^2+16\,b^3\right )}\right )\,\left (3\,a-4\,b\right )}{2\,a^3\,f\,\sqrt {a-b}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________